ifeq ($(strip $(targetbase)),linux)

ifeq ($(strip $(LINUX_LK)),TRUE)

include $(SDK_DIR)/mk/sys_km.mk

SDK_SAL_SRCS = $(shell find $(SDK_DIR)/sal/src/common -name "*.c")
SDK_SAL_SRCS += $(shell find $(SDK_DIR)/sal/src/linux_km -name "*.c")

SDK_SAL_OBJS = $(patsubst %.c,%.o,$(SDK_SAL_SRCS))
SDK_SAL_OBJS := $(subst $(SDK_DIR)/sal/,,$(SDK_SAL_OBJS))

lib-m += $(SDK_SAL_OBJS)

else

include $(MK_DIR)/sys.mk

OBJ_DIR=$(OBJ_BASE_DIR)/sal

LIB = sal
SRCS = $(shell find src/linux_um -name "*.c")
SRCS += $(shell find src/common -name "*.c")

CPPFLAGS += -I$(SDK_DIR)/sal/include

include $(MK_DIR)/lib.mk
endif
endif

ifeq ($(strip $(targetbase)),vxworks)

OBJ_DIR=$(OBJ_BASE_DIR)/sal

all_targets = src libsal

all: $(all_targets) FORCE
clean: $(addprefix clean_,$(all_targets)) FORCE

src: FORCE
	$(CTC_MAKE) -C $(SDK_DIR)/sal/src -f Makefile.vx

clean_src: FORCE
	$(CTC_MAKE) -C $(SDK_DIR)/sal/src -f Makefile.vx clean

libsal: FORCE
	$(CTC_MAKE) -f Makefile_libsal.vx

clean_libsal: FORCE
	$(CTC_MAKE) -f Makefile_libsal.vx clean

.PHONY: FORCE
FORCE:
endif
